import * as Cesium from "cesium";

class GosViewer {
    constructor(root, options) {
        var viewer = new Cesium.Viewer(root, {
            animation: false, //是否显示动画控件
            baseLayerPicker: false, //是否显示图层选择控件
            geocoder: false, //是否显示地名查找控件
            timeline: false, //是否显示时间线控件
            sceneModePicker: false, //是否显示投影方式控件
            navigationHelpButton: false, //是否显示帮助信息控件
            infoBox: false, //是否显示点击要素之后显示的信息
            sceneModePicker: false, //是否显示3D/2D选择器
            selectionIndicator: false,
            ...options,
        });
        viewer.trackedEntity = undefined;
        if (Cesium.FeatureDetection.supportsImageRenderingPixelated()) {
            viewer.resolutionScale = window.devicePixelRatio;
        }
        //是否开启抗锯齿
        viewer.scene.fxaa = true;
        viewer.scene.postProcessStages.fxaa.enabled = true;
        return viewer;
    }
}

export default GosViewer;
